create or replace function posterminalProducer2xml(bigint, text)
returns xml as
$$
	declare
		producerId alias for $1;
		nameProducer alias for $2;
	begin
		return 
			xmlelement(
				name posterminalproducer, xmlattributes(producerId as id), 
				xmlelement(name producername, nameProducer)
				)
		;
	end;
$$ language plpgsql immutable; -- same result for same data